package com.soft.service;

import java.util.List;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.util.Assert;

import com.soft.entity.Emp;

@SpringBootTest
public class EmpServiceTest {

    @Autowired
    private EmpService empService;
    @Test
    public void queryByDeptNameTest()
    {
    	List<Emp> empList = empService.queryByDeptName("公关部");
    	for(int i = 0;i < empList.size();i++)
    	{
    		System.out.println(empList.get(i).getEmp_name());
    	}
    	//Assert.isTrue(empList.size() == 2, "查询错误");
    }
    //@Test
    public void insertEmpTest()
    {
    	int num = empService.insertEmp("2","王朝","公关部","湖北","2025-3-21");
    	Assert.isTrue(num == 1, "增加员工错误");
    }
    //@Test
    public void updateEmpTest()
    {
    	int num = empService.updateEmpTest("王朝","雄安","生产部");
    	Assert.isTrue(num == 1, "修改员工错误");
    }
}